


//类 --
class Dog{
    //成员变量 - 属性
    public String name;
    public String color;

    //行为
    public void barks(){
        System.out.println(name+"汪汪");
    }
    public void wag(){
        System.out.println(name+"摇尾巴");
    }

}
public class Main{
    public static void main(String[] args) {
        //实例化一个Dog对象
        Dog dog = new Dog();
        dog.name = "来福";
        dog.color = "black";
        System.out.println(dog.name);
        System.out.println(dog.color);
        dog.barks();
        dog.wag();
    }
}